#ifndef BROWSERDIALOG_H
#define BROWSERDIALOG_H

#include <QFrame>
#include "../widgets.h"

namespace Ui {
class BrowserDialog;
}

class CefViewWidget;

struct ResizeDragData;
class S_WIDGETS_EXPORT BrowserDialog : public QFrame
{
    Q_OBJECT

public:
    explicit BrowserDialog(QWidget *parent = nullptr);
    ~BrowserDialog();

    void setContentWidget( CefViewWidget* content );
    void Navigate(const QString& url);

public slots:
    void setTitle(const QString& title);

private slots:
    void on_close_clicked();

    void on_resize_clicked(bool checked);

    void on_min_clicked();

    void on_refresh_clicked();

    void on_pin_clicked(bool checked);

protected:
    bool event(QEvent *e) override;

    void recurseSetMouseTracking(bool tracking);

private:
    Ui::BrowserDialog *ui;
    CefViewWidget* content_{nullptr};
    ResizeDragData* resizeDragData{nullptr};
};

#endif // BROWSERDIALOG_H
